package top.milkbox.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import top.milkbox.domain.Category;
import top.milkbox.service.CategoryService;
import top.milkbox.mapper.CategoryMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author xiaoguo
* @description 针对表【tb_category】的数据库操作Service实现
* @createDate 2022-04-26 20:51:35
*/
@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category>
    implements CategoryService{

    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public List<Category> findAllOrderByClassify() {
        QueryWrapper<Category> wrapper = new QueryWrapper<>();
        wrapper.orderByAsc("classify");

        return categoryMapper.selectList(wrapper);
    }
}




